﻿@{
    Layout = "~/Views/_LayoutPage1.cshtml";
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title></title>
</head>
<body>
    <input id="pbid" type="hidden" value="@ViewBag.pbid" />
    <input id="data" type="hidden" value="@ViewBag.data" />
   
    <div id="root">
        <div data-reactroot="">
            <div>
                <div class="page-patient-list">
                    <div class="ui-tips  center">最多添加 5 位就诊人，您还可以添加 @ViewBag.num 位</div>
                    <div id="J_PatientList">
                        @if (ViewBag.list.Count > 0)
                        {
                            for (int i = 0; i < ViewBag.list.Count; i++)
                            {
                                <ul class="list-ord" style="border: none; background-color: rgb(248, 248, 248);">

                                    <li class="list-item" style="margin: 10px; padding: 12px 10px; border: 1px solid rgb(221, 221, 221); border-radius: 4px; background-color: rgb(255, 255, 255); overflow: hidden;">
                                     
                                        <a onclick="hrefto('@ViewBag.list[i].brxm','@ViewBag.list[i].sfzh')" class="txt-arrowlink list-link-wrapper">
                                            <img src="~/Content/img/user.png" class="list-icon" style="width: 34px; height: 34px;">
                                            <div class="list-content">
                                                <div class="list-title">
                                                    @ViewBag.list[i].brxm
                                                    <span class="patient-type-label">成人</span>
                                                </div>
                                                <div class="list-brief">身份证号:@ViewBag.list[i].sfzh</div>
                                                @*<div class="txt-prompt list-brief">尚未绑定就诊卡，点击就诊人进行绑卡操作</div>*@
                                            </div>
                                            @if (!string.IsNullOrEmpty(ViewBag.pbid))
                                            {
                                                if (ViewBag.list[i].isdefault == 1)
                                                {
                                                    <img class="patient-select" src="~/Content/img/selbrxx.png">
                                                }
                                                else
                                                {
                                                    <div class="patient-no-select"></div>
                                                }

                                            }

                                        </a>
                                        @if (ViewBag.list[i].isdefault == 1)
                                        {
                                            <div class="default-patient-icon"></div>
                                        }

                                    </li>


                                </ul>
                            }
                        }

                        <div class="ui-tips center">点击就诊人管理就诊人信息</div>
                    </div>
                </div>

                @if (ViewBag.num > 0)
                {
                    <div class="btn-wrapper">
                        <a href="/UserInfo/UserInfo?pbid=@ViewBag.pbid" + class="btn btn-secondary btn-block">
                            <span class="add-patient-btn-icon">+</span>添加就诊人
                        </a>
                    </div>
                }

            </div>
        </div>
    </div>
    <script>
        $(function () {
            if ($("#pbid").val() != "") {
                $(".list-item a").removeClass("txt-arrowlink")
            }

        })
        function hrefto(brxm, sfzh) {
           
            if ($("#pbid").val() == "") {
                window.location.href = "/UserInfo/UserInfo?sfzh=" + sfzh;
            } else if ($("#pbid").val() == "1") {
                //当传过来的参数是1的时候,返回中医护理界面
                window.location.href = "http://xhyy.zhujf.xin/Yhhd/hdchat?data=" + $("#data").val() + "&brxm=" + brxm + "&sfzh=" + sfzh;;
            } else {
                //当传过来的参数是真实排版id的时候,返回中医护理界面
                window.location.href = "/Yygh/SelHyxx?pbid=" + $("#pbid").val() + "&brxm=" + brxm + "&sfzh=" + sfzh;;
            }
            
        }
    </script>
</body>
</html>
